<template>
  <iframe src="http://localhost:1208/api/doc/index.html" frameborder="0" style="width:100%;" ref="iframe"></iframe>
</template>

<script>
export default {
  name: 'Swagger',
  mounted() {
    this.$nextTick(() => {
      this.initPage();
    })
  },
  methods: {
    initPage() {
      const header = document.querySelector('.ant-pro-global-header').clientHeight;
      const multiTab = document.querySelector('.ant-pro-multi-tab-wrapper').clientHeight;
      this.$refs.iframe.style.height = `${document.querySelector('#app').clientHeight - header - multiTab - 60}px`
    }
  }
}
</script>
